package com.cloudkinto.service.shipprice;

import com.cloudkinto.entity.OrderOutputProductDo;
import com.cloudkinto.entity.ProductInfoDo;
import com.cloudkinto.entity.ShipPriceDo;
import com.baomidou.mybatisplus.extension.service.IService;

import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.service.shipprice.vo.ComputePriceReq;
import com.cloudkinto.service.shipprice.vo.TrackReq;
import com.cloudkinto.service.shipprice.vo.WarehousingPriceReq;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author ding
 * @since 2020-06-09
 */
public interface ShipPriceService extends IService<ShipPriceDo> {


    List<ShipPriceDo> queryByRegionAndSize(String postCode, double[] packageSize, Integer cod, Integer shipmentType, Long storageId, int version, Long companyId);

    List<ShipPriceDo> queryByRegionAndSize(String postCode, double[] packageSize, Integer cod, Integer shipmentType, Long storageId, int version, Integer bundling, Long companyId);

    List<ShipPriceDo> queryByRegionAndSize(Long stateId, double[] packageSize, Integer cod, Integer shipmentType, Long storageId, int version, Integer bundling,  Long companyId);

    ShipPriceDo queryByRegionAndSize(Long stateId, double[] packageSize, Long storageId, Long trackId, int version, Long companyId);

    ShipPriceDo queryByRegionAndSize(String postCode, double[] packageSize, Integer cod, Integer shipmentType, Long storageId, Long trackId, int version, Integer bundling, Long companyId);

    ShipPriceDo queryByRegionAndSize(Long stateId, double[] size, Integer cod, Integer shipmentType, Long storageId, Long trackId, int version, Integer bundling, Long companyId);

    SingleResult warehousingPrice(WarehousingPriceReq req, Long userId, Long companyId);

    SingleResult computePrice(ComputePriceReq req, Long userId, Long companyId);

    SingleResult computeInit();

    double[] getMulitSkuSize(List<OrderOutputProductDo> packageDetail);

    int getMulitSkuOperationFee(List<OrderOutputProductDo> packageDetail, String companyId);

    int getSameSkuOperationFee(Long productId, int count, String companyId);

    double[] countSameSkuSize(double[] finalSize, Long productId, int count);

    double[] countSameSkuSizeNew(double[] finalSize, ProductInfoDo productId, int count);

    double[] countSameSkuSizeNew(double[] inputSize, double size0, double size1, double size2, double weight, int count);

    double[] getSizeOrderDesc(double width, double height, double length);

    List<Map<String, Object>> getTrackList(TrackReq req, Long companyId);

    List<Map<String, Object>> getTrackList(List<OrderOutputProductDo> productDoList, Long storageId, String postCode, Integer shipmentType, int cod, Long companyId);


}
